package standalone;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

/**
 * author:xiaobo
 * date: 2016/7/29.
 */
public class WebPointLoad {


    static UUIDResourcesHandler resourcesHandler = new UUIDResourcesHandler();



    /**
     * web下载视屏文件  ，支持断点下载
     *
     * @param response
     * @param request
     * @param resource
     * @param type
     * @throws IOException
     */
    public static void pointLoad(HttpServletResponse response, HttpServletRequest request, final File resource, final String type) throws IOException, ServletException {
        UUIDFileResource res = new UUIDFileResource(resource,resource.getName());
        res.setMimeType(type);
        resourcesHandler.res(res).handleRequest(request,response);
    }



















}
